﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Labours
{
    class Worker:Human
    {
        private double weekSalary;
        private double workHoursPerDay;


        public double WeekSalary
        {
            get { return this.weekSalary; }
            set
            {
                if (value < 2000)
                {
                    throw new ArgumentOutOfRangeException("NOT ENOUGH");
                }
                else
                {
                    this.weekSalary = value;
                }
            }
        }

        public double WorkHoursPerDay
        {
            get { return this.workHoursPerDay; }
            set
            {
                if (value > 8)
                {
                    throw new ArgumentOutOfRangeException("TOO MUCH WORK !");
                }
                else
                {
                    this.workHoursPerDay = value;
                }
            }
        }

        public Worker(string firstName, string lastName, int salary, int workHours)
            : base(firstName, lastName)
        {
            this.WeekSalary = salary;
            this.WorkHoursPerDay = workHours;
        }

        public double MoneyPerHour()
        {
            return WeekSalary / (WorkHoursPerDay * 5.0);
        }
    }
}
